package com.lhkj.ct.meta.modules.patient.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lhkj.ct.base.model.Option;
import com.lhkj.ct.base.model.dto.PageQuery;
import com.lhkj.ct.meta.modules.patient.model.entity.TblPatCrowdTag;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *      档案人群标签 Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2023-09-25
 */
public interface PatCrowdTagMapper extends BaseMapper<TblPatCrowdTag> {

    /**
     * 分页查询
     */
    IPage<TblPatCrowdTag> selectCrowdTagPage(Page<TblPatCrowdTag> page, @Param("tag") TblPatCrowdTag tag,@Param("pageQuery") PageQuery pageQuery);

    /**
     * 列表查询
     */
    List<Option<String>> listOptions();

    @Select("select ifnull(max(sort), 0) + 1 from tbl_pat_crowd_tag")
    Integer selectMaxSort();
}
